package com.syni.mdd.sjb.community.base.controller.protect;

import com.syni.mdd.sjb.common.component.mybatis.common.mapper.DxshAppUserInfoMapper;
import com.syni.mdd.sjb.common.component.utils.feign.service.mdd.sjb.common.datatreasure.DxshApiIndustryRestService;
import com.syni.mdd.sjb.community.base.annotion.AdminAuthVerification;
import com.syni.mdd.sjb.community.base.entity.vo.rq.ChooseIndustryVo;
import com.syni.mdd.sjb.community.base.service.SjbQywxAdminRoleRelationService;
import com.syni.mdd.sjb.community.base.service.SjbQywxAdminService;
import com.syni.mdd.sjb.community.base.service.SjbQywxCompanyService;
import com.syni.mdd.sjb.community.base.service.SjbQywxCompanyUserService;
import lombok.extern.log4j.Log4j2;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.Map;

/**
 * 调用觅东东数据宝接口获取数据
 * 以后如果多起来，建议还是换取对应的token来复用以前接口
 * **/
@RestController
@RequestMapping("/dataTreasureFeign")
@Log4j2
public class DataTreasureFeignController {

    @Autowired
    SjbQywxAdminService sjbQxwxAdminService;

    @Autowired
    SjbQywxAdminRoleRelationService sjbQywxAdminRoleRelationService;

    @Autowired
    SjbQywxCompanyUserService sjbQywxCompanyUserService;

    @Autowired
    SjbQywxCompanyService sjbQywxCompanyService;

    @Autowired
    DxshAppUserInfoMapper dxshAppUserInfoMapper;

    @Autowired
    DxshApiIndustryRestService dxshApiIndustryRestService;


    @AdminAuthVerification
    @PostMapping("/getAllIndustry")
    public Map<String, Object> getAllIndustry(@RequestBody ChooseIndustryVo chooseIndustryVo) {
        return sjbQxwxAdminService.getAllIndustry();
    }

    @AdminAuthVerification
    @PostMapping("/chooseIndustry")
    public Map<String, Object> chooseIndustry(@RequestBody ChooseIndustryVo chooseIndustryVo) {
        return sjbQxwxAdminService.chooseIndustry(chooseIndustryVo);
    }

}
